package com.violet.common.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;

/**
 * 类说明:内部系统前后端响应数据实体
 *
 * @author wqf
 * @date 2021/7/12 17:08
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@Schema(description = "响应结果实体")
@Data
public class ResultBody<T> implements Serializable {
    /**
     * 请求响应状态
     */
    @Schema(description = "响应成功状态")
    private boolean success;
    /**
     * 错误码
     */
    @Schema(description = "http响应状态码")
    private int code;
    /**
     * 错误码
     */
    @Schema(description = "业务状态码")
    private String businessCode;
    /**
     * 提示信息
     */
    @Schema(description = "响应消息")
    private String msg;
    /**
     * 响应数据
     */
    @Schema(description = "响应数据")
    private T data;

    public ResultBody(boolean success, int code, String businessCode, String msg, T data) {
        this.success = success;
        this.code = code;
        this.businessCode = businessCode;
        this.msg = msg;
        this.data = data;
    }


}
